//
// Created by Administrator on 2023/2/1.
//

#include <iostream>

using namespace std;

int main()
{
    int a, b, c;
    scanf("%d %d %d", &a, &b, &c);
    // yy-mm-dd
    if (b < 13)
    {
        if (c < 32)
        {
            if (a > 59)
            {
                printf("yy-mm-dd: %d %02d %02d\n", a + 1900, b, c);
            }
            if (a <= 59)
            {
                printf("yy-mm-dd: %d %02d %02d\n", a + 2000, b, c);
            }
        }
    }
    // mm-dd-yy
    if (a < 13)
    {
        if (b < 32)
        {
            if (c > 59)
            {
                printf("mm-dd-yy: %02d %02d %d\n", a , b, c+ 1900);
            }
            if (c <= 59)
            {
                printf("mm-dd-yy: %02d %02d %d\n", a , b, c+ 2000);
            }
        }
    }
    // dd-mm-yy
    if (b < 13)
    {
        if (a < 32)
        {
            if(c>59)
            {
                printf("dd-mm-yy: %02d %02d %d\n",a,b,c+1900);
            }
            if(c<=59)
            {
                printf("dd-mm-yy: %02d %02d %d\n", a , b, c+ 2000);
            }
        }
    }
}